#include <string>
#include <vector>

using namespace std;

class Solution {
public:
    bool isAnagram(string s, string t) {
        vector<int> hasht(26, 0);
        for(char c:s){
            hasht[c - 'a']++;
        }
        for(char c:t){
            hasht[c - 'a']--;
        }
        
        for(int i = 0; i < hasht.size() ;i++){
            if(hasht[i] != 0) return false;
        }
        return true;
    }
};

int main(int argc, char const *argv[])
{
  Solution so;
  bool res = so.isAnagram("anagram", "nagaram");
  printf("%d", res);
  return 0;
}
